import phonenumbers
from phonenumbers import geocoder


# 获取用户手机号码归属地
def phone_location(phone_num):
    parsed_number = phonenumbers.parse(phone_num, "CN")
    location = geocoder.description_for_number(parsed_number, "zh")
    return location
